package com.bristua.barcode.supplier.biz;

import com.bristua.barcode.supplier.dao.TQrCodeCookieMapper;
import com.bristua.barcode.supplier.model.TQrCodeCookie;
import com.bristua.barcode.supplier.model.condition.TQrCodeCookieExample;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2019/9/6.
 */
@Service
@Transactional
public class QueryQrCodeCookieDetailBiz {

    @Resource
    private TQrCodeCookieMapper tQrCodeCookieMapper;

    public TQrCodeCookie queryQrCodeCookieDetail(String supplierId){
        TQrCodeCookieExample tQrCodeCookieExample = new TQrCodeCookieExample();
        tQrCodeCookieExample.createCriteria().andSupplierIdEqualTo(supplierId);
        List<TQrCodeCookie> tQrCodeCookieWithBLOBs = tQrCodeCookieMapper.selectByExampleWithBLOBs(tQrCodeCookieExample);
        if(tQrCodeCookieWithBLOBs!=null && tQrCodeCookieWithBLOBs.size()>0){
            return tQrCodeCookieWithBLOBs.get(0);
        }
        return null;
    }

}
